<?php
/**
 * Represents a checkbox
 */
fily_XMLConverter::registerNamespace('checkbox', fily_Checkbox);
class fily_Checkbox extends fily_Input {
    /**
     *
     */
    public function __construct() {
        parent::__construct();
        $this->attributes->set('type', 'checkbox');

    }

    /**
     * checks the checkbox
     */
    public function check() {
        $this->attributes->set('checked', 'checked');
    }

    /**
     * unchecks the checkbox
     */
    public function uncheck() {
        $this->attributes->remove('checked');
    }

    /**
     * returns if the checkbox is checked
     * @return boolean
     */
    public function isChecked() {
        return ($this->attributes->get('checked')=='checked');
    }
}

?>
